﻿using System;
using System.Collections;
using Huirui.Cavan.Domain.MainBoundedContext.SystemModule;
using System.Collections.Generic;
using Huirui.Cavan.Domain.Seedwork;

namespace Huirui.Cavan.Domain.MainBoundedContext.SalesModule
{
    #region OtherReceivable

    /// <summary>
    /// OtherReceivable object for NHibernate mapped table 'OtherReceivables'.
    /// </summary>
    [Serializable]
    public class Receivables : Persistent<long>
    {
        #region Member Variables

        protected DateTime _receiveDate;
        protected string _currency;
        protected decimal _currencyRate;
        protected string _remark;
        protected decimal _discount;
        protected Account _receiptAccount;
        protected int _payDay;
        protected DateTime _deadDate;
        protected decimal _amount;
        protected decimal _leftAmount;
        protected SalesIdentifier.ReceivablesType _receivablesType;
        protected string _receivablesCode;
        protected Corporation _corporation;
        protected Customer _customer;
        protected Employee _receiveEmployee;
        protected Project _project;
        protected IList<ReceivablesDetail> _receivablesDetails;

        #endregion

        #region Constructors

        public Receivables() { }

        public Receivables(DateTime receiveDate, string currency, decimal currencyRate, string remark, decimal discount, 
            Account receiptAccount, int payDay, DateTime deadDate, decimal amount, SalesIdentifier.ReceivablesType receivablesType, string receivablesCode,
            DateTime createDate, DateTime modifyDate, int editUser, Corporation corporation, Customer customer, Employee receiveEmployee, Project project)
        {
            this._receiveDate = receiveDate;
            this._currency = currency;
            this._currencyRate = currencyRate;
            this._remark = remark;
            this._discount = discount;
            this._receiptAccount = receiptAccount;
            this._payDay = payDay;
            this._deadDate = deadDate;
            this._amount = amount;
            this._createDate = createDate;
            this._modifyDate = modifyDate;
            this._editUser = editUser;
            this._corporation = corporation;
            this._customer = customer;
            this._receiveEmployee = receiveEmployee;
            this._project = project;
            this._receivablesType = receivablesType;
            this._receivablesCode = receivablesCode;
            this._leftAmount = this._amount;
        }

        #endregion

        #region Public Properties


        public virtual DateTime ReceiveDate
        {
            get { return _receiveDate; }
            set { _receiveDate = value; }
        }

        public virtual string Currency
        {
            get { return _currency; }
            set
            {
                if (value != null && value.Length > 20)
                    throw new ArgumentOutOfRangeException("Invalid value for CurrencyCode", value, value.ToString());
                _currency = value;
            }
        }

        public virtual decimal CurrencyRate
        {
            get { return _currencyRate; }
            set { _currencyRate = value; }
        }

        public virtual string Remark
        {
            get { return _remark; }
            set
            {
                _remark = value;
            }
        }

        public virtual decimal Discount
        {
            get { return _discount; }
            set { _discount = value; }
        }

        public virtual Account ReceiptAccount
        {
            get { return _receiptAccount; }
            set
            {
                _receiptAccount = value;
            }
        }

        public virtual int PayDay
        {
            get { return _payDay; }
            set { _payDay = value; }
        }

        public virtual DateTime DeadDate
        {
            get { return _deadDate; }
            set { _deadDate = value; }
        }

        public virtual decimal Amount
        {
            get { return _amount; }
            set { _amount = value; }
        }


        public virtual decimal LeftAmount
        {
            get { return _leftAmount; }
            set { _leftAmount = value; }
        }

        public virtual SalesIdentifier.ReceivablesType ReceivablesType
        {
            get { return _receivablesType; }
            set { _receivablesType = value; }
        }

        public virtual string ReceivablesCode
        {
            get { return _receivablesCode; }
            set { _receivablesCode = value; }
        }

        public virtual Corporation Corporation
        {
            get { return _corporation; }
            set { _corporation = value; }
        }

        public virtual Customer Customer
        {
            get { return _customer; }
            set { _customer = value; }
        }

        public virtual Employee ReceiveEmployee
        {
            get { return _receiveEmployee; }
            set { _receiveEmployee = value; }
        }

        public virtual Project Project
        {
            get { return _project; }
            set { _project = value; }
        }


        #endregion
    }
    #endregion
}